Skip to content

feat(pii): add data collection options#2156

Draft
Litarnus wants to merge 3 commits into
data-collection-basefrom
data-collection-config
Draft

feat(pii): add data collection options#2156
Litarnus wants to merge 3 commits into
data-collection-basefrom
data-collection-config

Conversation

@Litarnus

@Litarnus Litarnus commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Adds DataCollectionOptions class which works as a container for all data collection specific options. It works similar to the already established Options class, but since options are already big enough I decided to move this into it's own class.

Init happens normally using nested arrays:

\Sentry\init([
    'data_collection' => [
        'http_headers' => [
            'request' => [
                'mode' => 'allowList'
            ]
        ]    
    ]
]);

Also implements ArrayAccess to make accessing nested fields more intuitive and to avoid constructs such as:

$options->getDataCollection()->getHttpHeaders()['request']['terms']

and we can instead use

$options->getDataCollection()['http_headers']['request']['terms']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant